from django.db import models

class Account(models.Model):
  email = models.EmailField(unique=True)
  password = models.CharField(max_length=20, default='googleapp')
  phone_num = models.CharField(max_length=20, blank=True, null=True)

  def __unicode__(self):
    return self.email

class App(models.Model):
  name = models.CharField(max_length=60)
  created_at = models.DateTimeField(auto_now_add=True)

  account = models.ForeignKey('Account')
  flag = models.BooleanField(default=False)
  
  last_update_started = models.BooleanField(default=False)
  last_update_ended = models.BooleanField(default=False)
  last_update_succeed_at = models.DateTimeField(blank=True, null=True)
  
  def __unicode__(self):
    return self.name

